#!/usr/bin/python


def calc_height(width):
    w = [width]                 # w[0] = width
    while w[-1] > 2:
        w.append(2*(w[-1]/3) + (w[-1]%3))
    return w

w = calc_height(5)
print w

